package com.hnjd.service;

import java.util.List;

import com.hnjd.entity.Carts;
import com.hnjd.entity.Goods;
import com.hnjd.entity.Items;
import com.hnjd.entity.Orders;
import com.hnjd.entity.Tops;
import com.hnjd.entity.Users;
import com.hnjd.util.PageUtil;

public interface IindexService {

	List<Goods> indexList();

	Users login(String username,String password);

	Integer register(Users users);

	Integer addressUpdate(Orders orders);

	int[] ordersById(String name);

	Integer passwordUpdate(String passwordNew,Integer id);

	List<Orders> orderList();

	Goods itemsByGoodsId(Integer id);

	List<Items> itemsByOrderId(Integer order_id);

	List<Carts> cartsByUserId(Integer user_id,PageUtil page);

	Goods goodsById(Integer id);

	Integer[] orderByUserId(Integer user_id);

	Integer cartsNum(Integer user_id);

	Integer cartUpdate(Integer id,Integer amount);

	Integer cartDelete(Integer id);

	List<Carts> cartsByUserList(Integer user_id);

	//添加购物车
	public Integer addCart(Integer goodid,Integer userid);


	//判断购物车中是否含有这个商品
	public Integer cartExict(Integer goodid,Integer userid );

	//存在相同商品amount加一
	public Integer addAmount(Integer goodid,Integer userid );

	public List<Goods> findGoodsById();

	public List<Tops> findAllTops();

	public void topSave(Tops top);

	public List<Goods> findGoods(PageUtil page);


	public void topDelete(Integer goodId);

	//分页查询 今日推荐
	public Object findGoodsTop(int curpage,int pagesize);


	//查询所有热销商品
	public  Object   findSalesGoods(int curpage,int pagesize);
	
	public boolean generetorOrder(Users user);
}
